<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script>
		<script>
			// 创建与服务器的连接
			const socket = io("http://127.0.0.1:3001"); // 根据你的服务器地址和端口修改
			
			// 设置事件处理程序
			socket.on("connect", () => {
			    console.log("Connected to server");
			});
			
			socket.on("message", (data) => {
			    console.log("Received message:", data);
			});
			
			socket.on('tick', (data) => {
			  console.log('Received tick event:', data);
			  // 在这里处理接收到的 tick 事件数据
			});
			
			// 发送消息到服务器
			socket.emit("someEvent", { message: "Hello, server!" });
		</script>
	</head>
	<body>
	</body>
</html>